function sleep(name,time) {
  return new Promise((resolve,reject)=>{
    setTimeout(function(){
      resolve("执行"+name+"函数，等待"+time/1000+"秒");
    },time)
  });
}

async function test() {
  var t1 = await sleep("t1",2000);
  console.log(t1);

  var t2 = await sleep("t2",1000);
  console.log(t2);

  var t3 = await sleep("t3",0);
  console.log(t3);

  return [t1,t2,t3];
}


test().then(r=>console.log(r));
